home *** CD-ROM | disk | FTP | other *** search
/ T&A 2 the Maxx 3 / T and A 2 The Maxx Number 3.iso / viewers / unixview / xgiftar.z / xgiftar / Makefile.std < prev    next >
Makefile  |  1991-05-20  |  7KB  |  191 lines

  1. # Makefile for xloadimage.  this replaces the multiple makefiles used in
  2. # versions prior to xloadimage 2.00.
  3. #
  4. # WARNING: if you use gcc 1.37, there is an optimizer bug which causes GIF
  5. # images to come out black and colormap reduction to fail.  Use gcc-1-37 as
  6. # your make target if you have gcc 1.37.
  7.  
  8. SYSPATHFILE=/usr/lib/X11/Xloadimage
  9. INSTALLDIR=/usr/bin/X11
  10. SHELL= /bin/sh
  11. MAKE= make
  12. STD_CC= cc
  13. GCC= gcc
  14. CP= cp
  15. LN= ln -s
  16. RM= rm -f
  17. LIBS= -lX11 -lm
  18. CFLAGS= -O -DSYSPATHFILE=\"$(SYSPATHFILE)\" $(EXTRAFLAGS)
  19. GCCFLAGS= -fstrength-reduce -finline-functions
  20. GCC137FLAGS= -fforce-mem -fforce-addr -fstrength-reduce -finline-functions
  21.  
  22. MISC= Imakefile Makefile Makefile.std README build-imake buildshar.c \
  23.       xloadimage.man patchlevel mcidas.h pbm.h rle.h sunraster.h \
  24.       xloadimage.h xwd.h
  25.  
  26. INCS= cmuwmraster.h copyright.h fbm.h g3.h gif.h image.h img.h \
  27.       imagetypes.h kljcpyrght.h mac.h mit.cpyrght mrmcpyrght.h \
  28.       options.h tgncpyrght.h
  29.  
  30. SRCS= bright.c clip.c cmuwmraster.c compress.c dither.c faces.c fbm.c \
  31.       fill.c g3.c gif.c halftone.c imagetypes.c img.c mac.c mcidas.c \
  32.       mc_tables.c merge.c misc.c new.c options.c path.c pbm.c pcx.c \
  33.       reduce.c rle.c rlelib.c root.c rotate.c send.c smooth.c sunraster.c \
  34.       value.c window.c xbitmap.c xloadimage.c xpixmap.c xwd.c zio.c zoom.c
  35.  
  36. OBJS= bright.o clip.o cmuwmraster.o compress.o dither.o faces.o fbm.o \
  37.       fill.o g3.o gif.o halftone.o imagetypes.o img.o mac.o mcidas.o \
  38.       mc_tables.o merge.o misc.o new.o options.o path.o pbm.o pcx.o \
  39.       reduce.o rle.o rlelib.o root.o rotate.o send.o smooth.o sunraster.o \
  40.       value.o window.o xbitmap.o xloadimage.o xpixmap.o xwd.o zio.o zoom.o
  41.  
  42. ALL= $(MISC) $(INCS) $(SRCS)
  43.  
  44. # standard target.  this is for BSD-like environments, generally, although
  45. # it will also work in many System-V environments.
  46.  
  47. std:
  48.     @echo "Building standard distribution.  If this fails, consider trying"
  49.     @echo "'make sysv'."
  50.     $(MAKE) xloadimage CC=$(STD_CC)
  51.  
  52. # system-v target.  use this if you have a system-v compliant system.
  53.     
  54. sysv:
  55.     @echo "Building standard distribution for System-V."
  56.     $(MAKE) xloadimage CC=$(STD_CC) EXTRAFLAGS=-DSYSV
  57.  
  58. # gcc target.  use this if you have a gcc that is not version 1.37.  you
  59. # should add -DSYSV between the quotes in EXTRAFLAGS if your system is
  60. # system-v compliant as well.
  61.  
  62. gcc:
  63.     @echo "Building distribution with GNU cc."
  64.     @echo "**************************************************************"
  65.     @echo "If you use gcc 1.37, you should abort and type 'make gcc-1-37'"
  66.     @echo "instead.  If GIF images always display solid black or if"
  67.     @echo "color images reduce to only a single color, your version"
  68.     @echo "of gcc has a bug and you should use the gcc-1-37 target."
  69.     @echo "If something else doesn't work, try using 'make gcc-1-37' and"
  70.     @echo "then 'make std' before reporting a bug."
  71.     @echo "**************************************************************"
  72.     $(MAKE) xloadimage CC=$(GCC) EXTRAFLAGS="$(GCCFLAGS)"
  73.  
  74. # this target is for systems which use gcc 1.37.  there is a compiler bug
  75. # in gcc 1.37 which causes some xloadimage functions to fail with the
  76. # standard optimizations.  use this if GIF loading and colormap reduction
  77. # product black pictures.
  78.  
  79. gcc-1-37:
  80.     @echo "Building distribution with GNU cc using flags for gcc 1.37."
  81.     @echo "If something doesn't work, try using std before reporting"
  82.     @echo "a bug."
  83.     $(MAKE) xloadimage CC=$(GCC) EXTRAFLAGS="$(GCC137FLAGS)"
  84.  
  85. sysv-gcc:
  86.     @echo "Building System-V distribution with GNU cc."
  87.     @echo "Building distribution with GNU cc."
  88.     @echo "***********************************************************"
  89.     @echo "If you use gcc 1.37, you should abort and type"
  90.     @echo "'make sysv-gcc-1-37' instead.  If GIF images always display"
  91.     @echo "solid black or if color images reduce to only a single"
  92.     @echo "color, your version of gcc has a bug and you should use"
  93.     @echo "the gcc-1-37 target.  If something else doesn't work, try"
  94.     @echo "using 'make sysv-gcc-1-37' and then 'make std' before"
  95.     @echo "reporting a bug."
  96.     @echo "***********************************************************"
  97.     $(MAKE) xloadimage CC=$(GCC) EXTRAFLAGS="-DSYSV $(GCCFLAGS)"
  98.  
  99. # see comment for gcc-1-37 target.
  100.  
  101. sysv-gcc-1-37:
  102.     @echo "Building System-V distribution with GNU cc using flags for"
  103.     @echo "gcc 1.37.  If something doesn't work, try using std before"
  104.     @echo "reporting a bug."
  105.     $(MAKE) xloadimage CC=$(GCC) EXTRAFLAGS="-DSYSV $(GCC137FLAGS)"
  106.  
  107. install: $(SYSPATHFILE)
  108.     $(RM) $(INSTALLDIR)/xloadimage
  109.     $(RM) $(INSTALLDIR)/xsetbg
  110.     $(RM) $(INSTALLDIR)/xview
  111.     $(CP) xloadimage $(INSTALLDIR)/xloadimage
  112.     $(LN) $(INSTALLDIR)/xloadimage $(INSTALLDIR)/xsetbg
  113.     $(LN) $(INSTALLDIR)/xloadimage $(INSTALLDIR)/xview
  114.  
  115. xloadimage: $(OBJS)
  116.     $(CC) $(CFLAGS) -o xloadimage $(OBJS) $(LIBS)
  117.  
  118. .c.o: xloadimage.h
  119.     $(CC) -c $(CFLAGS) $*.c
  120.  
  121. clean:
  122.     rm -f *.o *~ xloadimage buildshar doshar shar.* *.tar *.tar.Z
  123.  
  124. $(SYSPATHFILE):
  125.     @echo "*** Creating default $(SYSPATHFILE) since you"
  126.     @echo "*** don't have one. This file is used to set up default places"
  127.     @echo "*** and names to look for images.  You probably want to edit"
  128.     @echo "*** it for your site.  See the xloadimage manual page for"
  129.     @echo "*** details on the contents of this file."
  130.     cp /dev/null $(SYSPATHFILE)
  131.     echo "path= /usr/local/images" \
  132.         >> $(SYSPATHFILE)
  133.     echo "extension=.csun .msun .sun .face .xbm .bm .gif" \
  134.         >>$(SYSPATHFILE)
  135.  
  136. # this is for building Imakefiles and such for distributions
  137.  
  138. new-imake:
  139.     rm -f Imakefile Makefile.std
  140.     cp Makefile Makefile.std # backup in case they want it
  141.     ./build-imake "$(SRCS)" "$(OBJS)"
  142.  
  143. # these targets are for building shar distributions
  144.  
  145. buildshar: buildshar.o
  146.     $(CC) -o buildshar buildshar.o
  147.  
  148. shar: buildshar new-imake
  149.     rm -f shar.* doshar
  150.     ./buildshar $(ALL) > doshar
  151.     sh doshar
  152.     rm -f doshar Makefile.std
  153.  
  154. # targets for building tar distributions
  155.  
  156. tar: xloadimage.tar
  157.  
  158. tar.Z: xloadimage.tar
  159.     compress xloadimage.tar
  160.  
  161. xloadimage.tar: new-imake
  162.     tar cf xloadimage.tar $(ALL)
  163.     rm -f Imakefile Makefile.std
  164.  
  165. # target for building debuggable versions
  166.  
  167. debug:
  168.     @echo Building a debugging version of xloadimage.
  169.     make xloadimage CC=$(STD_CC) CFLAGS="-g -DDEBUG -DSYSPATHFILE=\\\"$(SYSPATHFILE)\\\""
  170.  
  171. debug-sysv:
  172.     @echo Building a debugging version of xloadimage for System-V.
  173.     make xloadimage CC=$(STD_CC) CFLAGS="-g -DDEBUG -DSYSPATHFILE=\\\"$(SYSPATHFILE)\\\" -DSYSV"
  174.  
  175. # these targets are for those of us who have Saber-C
  176.  
  177. # load all objects in saber.  useful if you then swap the portions to debug
  178. # for source.
  179.  
  180. objinsaber:
  181.     #setopt ccargs -g -DSYSPATHFILE=\\\"$(SYSPATHFILE)\\\"
  182.     #load $(OBJS) $(LIBS)
  183.     #link
  184.  
  185. # load all sources in saber.  not as useful as the last one.
  186.  
  187. srcinsaber:
  188.     #setopt load_flags -DSYSPATHFILE=\\\"$(SYSPATHFILE)\\\"
  189.     #load $(SRCS) $(LIBS)
  190.     #link
  191.